<?php /* @var $this Controller */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

	<!-- blueprint CSS framework -->
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->
    <link rel="shortcut icon" href="<?php echo Yii::app()->request->baseUrl; ?>/contents/Images/favicon.ico" type="image/x-icon" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
	<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/colorbox.css" type="text/css" media="screen" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
    
    <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/layout.css?v=1.4" type="text/css" media="screen" />

    
    <script>
        function display_c(){
            var refresh=1000; // Refresh rate in milli seconds
            mytime=setTimeout('display_ct()',refresh)
        }
        function display_ct() {
            var strcount
            var x = new Date()
            var x1=x.toString();// changing the display to UTC string
            var x2 = x1.slice(0, -32);
            document.getElementById('clock').innerHTML = x2;
            tt=display_c();
         }
    </script>
    <script>            
			jQuery(document).ready(function() {
				var offset = 220;
				var duration = 500;
				jQuery('.back-to-top').fadeOut(0);
				jQuery(window).scroll(function() {
					if (jQuery(this).scrollTop() > offset) {
						jQuery('.back-to-top').fadeIn(duration);
					} else {
						jQuery('.back-to-top').fadeOut(duration);
					}
				});
				
				jQuery('.back-to-top').click(function(event) {
					event.preventDefault();
					jQuery('html, body').animate({scrollTop: 0}, duration);
					return false;
				})
			});
    </script>
    <style>		
		.back-to-top {
			position: fixed;
			bottom: 2em;
			right: 0px;
			text-decoration: none;
			color: #fff;
			background: url("<?php echo Yii::app()->request->baseUrl; ?>/css/bg.gif") repeat-x scroll left top white;
			font-size: 12px;
			padding: 1em;
			display: none;
		}

		.back-to-top:hover {	
			background: url("<?php echo Yii::app()->request->baseUrl; ?>/css/bg.gif") repeat-x scroll left top white;
            text-decoration: none;
		}	
        .container:before,
        .container:after {
          content:"";
          display:table;
        }
        .container:after {
          clear:both;
        }
        .container {
          zoom:1; /* For IE 6/7 (trigger hasLayout) */
        }
    </style>
    

	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body onload=display_ct();>
<header id="header">
		<hgroup id="header_container">
			<h1 class="site_title">THỰC PHẨM BOXANH</a></h1>
			<h2 class="section_title"><?php echo strtoupper($this->pageTitle); ?></h2><!--div class="btn_view_site"><a href="">View Site</a></div-->
            <h2 class="section_title" style="
                width: 350px;
font-size: 10.2pt;
position: absolute;
margin-left: 915px;
line-height: 63px;
            " id="clock"><?php echo date("D M j Y G:i",time()); ?></h2>
		</hgroup>
</header>
<?php 
$controllerName = strtoupper(Yii::app()->controller->id); 
?>
<div class="container" id="main_container" style="
    background-color: #fff;
">
    <aside id="sidebar_" class="column">
        <div class="user">
            <p>Hi, <?php echo Yii::app()->user->name; ?>. <a style="
    color: #FFFFFF;
" href="<?php echo $this->createUrl('site/logout'); ?>" >Đăng xuất</a></p>
                <!-- <a class="logout_user" href="#" title="Logout">Logout</a> -->
        </div>
        <section class="acc-container">
                <div class='<?php echo($controllerName == 'ADMIN/PRODUCTADMIN' ? 'item-active' : '' ); ?>'>
                    <label class="ac-2"><a href="<?php echo $this->createUrl('admin/product/index'); ?>">SẢN PHẨM</a></label>
				</div>
                <div class='<?php echo($controllerName == 'ADMIN/CATEGORYADMIN' ? 'item-active' : '' ); ?>'>
                    <label class="ac-2"><a href="<?php echo $this->createUrl('admin/category/index'); ?>">LOẠI SẢN PHẨM</a></label>
				</div>
                <div class='<?php echo($controllerName == 'ADMIN/ORDERADMIN' ? 'item-active' : '' ); ?>'>
                    <label class="ac-2"><a href="<?php echo $this->createUrl('admin/order/index'); ?>">ĐƠN HÀNG</a></label>
				</div>
                <div class='<?php echo($controllerName == 'ADMIN/ADVERTISINGADMIN' ? 'item-active' : '' ); ?>'>
                    <label class="ac-2"><a href="<?php echo $this->createUrl('admin/advertising/index'); ?>">TIN TỨC</a></label>
				</div>
				<?php $is_visible = Administator::model()->checkAdmin();?>
				<?php if ($is_visible): ?>
				<div class='<?php echo($controllerName == 'ADMIN/USERADMIN' ? 'item-active' : '' ); ?>'>
                    <label class="ac-2"><a href="<?php echo $this->createUrl('admin/user/index'); ?>">NGƯỜI DÙNG</a></label>
				</div>
				<?php else: ?>
				<div class='<?php echo($controllerName == 'ADMIN/USERADMIN' ? 'item-active' : '' ); ?>'>
					<?php $user = Administator::model()->findAll("username='".Yii::app()->user->name."'"); ?>
                    <label class="ac-2"><a href="<?php echo $this->createUrl('admin/user/update/',array('id'=>$user[0]->id)); ?>">NGƯỜI DÙNG</a></label>
				</div>
				<?php endif; ?>
        </section>
        
    </aside><!-- end of sidebar -->
    <section id="main" class="column">
    <article class="module width_3_quarter">
        <?php echo $content; ?>
    </article>
        <a href="#" class="back-to-top" style="display: inline;color: #fff;;font-weight: bold;">Back to Top</a>
    </section>
</div><!-- page -->
<div class="clear"></div>
<div id="footer">
		Copyright &copy; <?php echo date('Y'); ?> by Boxanhfood.<br/>
		All Rights Reserved.<br/>
</div><!-- footer -->
</body>
</html>